<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>分类管理</title>
	<link rel="stylesheet" href="/Shopping/Public/Css/admin.css"/>
</head>
<body>
	<div id="header">
		<div class="top">
			<ul>
				<li><a href="<?php echo U('Login/loginOut');?>">❤退出❤</a></li>
				<li style="">欢迎您!<?php echo ($_SESSION['admin']['username']); ?></li>
			</ul>
		</div>
		<div class="h_main">
			<span>购物商城后台管理系统</span>
		</div>
	</div>
	<div id="middle"></div>
	<div class="main mt">
		<div class="m_left fl">
			<ul>
				<a href="<?php echo U('Goods/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>商品管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Cate/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>分类管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('User/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>用户管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Order/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>订单管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Comments/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>评论管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Adver/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>广告管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
			</ul>
		</div>
	<div class="m_right fr">
		<div class="mright_m">
		
<div class="agoods_nav">
		<span>分类列表</span>
		<a href="<?php echo U('index',['id'=>$ppid]);?>"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">返回上级</button></a>
		<a href="<?php echo U('Cate/add');?>"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">添加一级分类</button></a>
	</div>	
	<table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
		<tr bgcolor="#ccc">
			<th>编号</th>
			<th>类名</th>
			<th>PID</th>
			<th>层级</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
		<?php if(!empty($list)): if(is_array($list)): foreach($list as $key=>$val): ?><tr>
					<td><?php echo ($val['id']); ?></td>
					<td><?php echo ($val['name']); ?></td>
					<td><?php echo ($val['pid']); ?></td>
					<td><?php echo ($val['path']); ?>级分类</td>
					<td width="100px;">
					<?php if($val['status'] == 1): ?><a href="<?php echo U('Cate/change',['id'=>$val['id'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">YES</button></a>
					<?php else: ?>
					<a href="<?php echo U('Cate/change',['id'=>$val['id'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">NO</button></a><?php endif; ?>
				</td>
					<td><a href="<?php echo U('Cate/add',['id'=>$val['id'],'p'=>$p]);?>" style="color:#000;display:block">添加子分类</a><a href="<?php echo U('Cate/index',['id'=>$val['id'],'ppid'=>$val['ppid']]);?>" style="color:#000;">查看子类</a>|<a href="<?php echo U('Cate/del',['id'=>$val['id']]);?>" style="color:#000;">删除</a></td>
				</tr><?php endforeach; endif; ?>
			<?php else: ?>
				<tr>
					<td colspan="6">没有子类</td>	
				</tr><?php endif; ?>
			<tr>
				<th colspan="6">
				 	<?php echo ($page); ?>
				</th>
			</tr>
		</table>

		</div>
	</div>
</div>
<div class="clear"></div>
<div id="middle"></div>
<div id="footer">
	<p>Copyright&copy; 2016年 京ICP备11011334号</p>
</div>

</body>
</html>